import { KeyBoardManager } from "../../../com/gengine/keyBoard/KeyBoardManager";
import { KeyEvent } from "../../../com/gengine/keyBoard/KeyEvent";
import { KeyCode } from "../../../com/gengine/keyBoard/KeyCode";
import { KeyBoardCd } from "../../common/cd/KeyBoardCd";
import { TextInput } from "../../../fl/controls/TextInput";
import { TestPanel } from "../view/test/TestPanel";
import { ParamsConst } from "../../common/global/ParamsConst";
import { Cache } from "../cache/Cache";
import { GameConst } from "../../component/gconst/GameConst";
import { ThingUtil } from "../scene/layer/utils/ThingUtil";
import { PopupManager } from "./PopupManager";
import { JSASSender } from "../../../extend/js/JSASSender";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { DataEvent } from "../events/DataEvent";
import { EventName } from "../mvc/EventName";
import { SystemSetter } from "../view/system/SystemSetter";
import { GameController } from "../mvc/GameController";
import { ChatModule } from "../../../modules/ChatModule";
import { Global } from "../../../com/gengine/global/Global";
import { DebugWindow } from "../../component/window/DebugWindow";
import { ModuleType } from "../view/common/ModuleType";
import { RolePlayer } from "../scene/player/entity/RolePlayer";
import { ScreenOperation } from "../scene/ScreenOperation";
import { ArenaCrossBetWindow } from "../view/arenaCross/arenaCrossFinal/ArenaCrossBetWindow";
import { SoundManager } from "../../common/sound/SoundManager";
import { SoundTypeConst } from "../../common/sound/SoundTypeConst";
import { GuildEventName } from "../view/guild/GuildEventName";
import { GuildUnionPosition } from "../view/guild/union/rule/GuildUnionPosition";
import { ECareer } from "../../../Message/Public/ECareer";
import { MsgManager } from "./MsgManager";
import { Language } from "../../../extend/language/Language";
import { PetUtil } from "../view/pet/info/PetUtil";
import { ENpcEffect } from "../../../Message/Public/ENpcEffect";
import { AutoFight } from "../view/autoFight/AutoFight";
import { BrowerManager } from "../../../com/gengine/manager/BrowerManager";
import { BrowerUtil } from "../../../com/gengine/utils/BrowerUtil";
import { ShopRule } from "../rules/ShopRule";
import { NormalShopType } from "../view/shop/info/NormalShopType";
import { EPrictUnit } from "../../../Message/Public/EPrictUnit";
import { GameProxy } from "../mvc/GameProxy";
import { CopyConfig } from "../resource/CopyConfig";
import { ECopyType } from "../../../Message/Public/ECopyType";
import { PetRecoverWindow } from "../view/pet/recover/PetRecoverWindow";
import { EWuXingAttribute } from "../../../Message/Public/EWuXingAttribute";
import { GameDefConfig } from "../resource/GameDefConfig";
import { IView } from "../../mvc/interfaces/IView";
import { CrossTaskWin } from "../view/crossTask/CrossTaskWin";
import { DrugShop } from "../../../NormalShopType/DrugShop";
import { ArmorShop } from "../../../NormalShopType/ArmorShop";
import { WeaponShop } from "../../../NormalShopType/WeaponShop";
import { DefaultShop } from "../../../NormalShopType/DefaultShop";
import { ExchangeShop } from "../../../NormalShopType/ExchangeShop";
import { _EPriceUnitHonour } from "../../../EPrictUnit/_EPriceUnitHonour";
import { _EPriceUnitInterHonour } from "../../../EPrictUnit/_EPriceUnitInterHonour";
import { _EPriceUnitArena } from "../../../EPrictUnit/_EPriceUnitArena";
import { _EPriceUnitArenaCrossCoin } from "../../../EPrictUnit/_EPriceUnitArenaCrossCoin";
import { _EPriceUnitPetCoin } from "../../../EPrictUnit/_EPriceUnitPetCoin";
import { _EPriceUnitRobIslandCoin } from "../../../EPrictUnit/_EPriceUnitRobIslandCoin";
import { _EPriceUnitSpiritCoin } from "../../../EPrictUnit/_EPriceUnitSpiritCoin";
import { _EPriceUnitLadder } from "../../../EPrictUnit/_EPriceUnitLadder";
import { _EPriceUnitMagicStone } from "../../../EPrictUnit/_EPriceUnitMagicStone";
import { _EPriceUnitCountryContribution } from "../../../EPrictUnit/_EPriceUnitCountryContribution";
import { _EPriceUnitDominion } from "../../../EPrictUnit/_EPriceUnitDominion";
import { LoveTileShop } from "../../../NormalShopType/LoveTileShop";
import { RobFlagShopCode } from "../../../GameConst/RobFlagShopCode";
import { _EPriceUnitRobFlagHonour } from "../../../EPrictUnit/_EPriceUnitRobFlagHonour";
type int = number;
//class GameManager
    
    export  class GameManager
    {
        constructor()
        {
            
            if (GameManager._instance != null) 
            {
                throw new Error("GameManager 单例");
            }
            return;
        }

        public init(): void
        {
            KeyBoardManager.instance.addEventListener(KeyEvent.KEY_DOWN, this.onKeyDownHandler);
            KeyBoardManager.instance.addEventListener(KeyEvent.KEY_UP, this.onKeyUpHandler);
            KeyBoardManager.instance.start();
            return;
        }

        /* internal  */onKeyUpHandler(arg1: KeyEvent): void
        {
            var loc1=arg1.keyEvent.keyCode;
            if (loc1 == KeyCode.D) 
            {
                KeyBoardCd.keyUp(loc1);
            }
            return;
        }

        /* internal  */onKeyDownHandler(arg1: KeyEvent): void
        {
            if (arg1.keyEvent.target is flash.text.TextField) 
            {
                if (arg1.keyEvent.target.type == flash.text.TextFieldType.INPUT) 
                {
                    return;
                }
            }
            if (typeof arg1.keyEvent.target === "textinput") 
            {
                return;
            }
            if (this.hasKeyCodeEvent(arg1.keyEvent.keyCode, arg1) == false) 
            {
                if (arg1.keyData.keyMap) 
                {
                    this.KeyEventHandler(arg1.keyData.keyMap.key, arg1);
                }
            }
            return;
        }

        /* internal  */showDebugWionw(arg1: uint): void
        {
            if (arg1 == KeyCode.I) 
            {
                this.debug();
            }
            if (arg1 == KeyCode.N) 
            {
                if (!this._testPanel) 
                {
                    this._testPanel = new TestPanel();
                }
                this.popupView(this._testPanel);
            }
            return;
        }

        /* internal  */hasKeyCodeEvent(arg1: uint, arg2: KeyEvent): Boolean
        {
            var loc1=ParamsConst.instance.loginIP;
            if (loc1 == "183.63.132.226: 9500" || loc1 == "183.63.132.227: 9500" || loc1 == "183.63.132.228: 9500" || loc1 == "183.63.132.229: 9500" || loc1 == "183.63.132.230: 9500" || loc1 == "118.26.204.237: 9500" || loc1 == "192.168.9.175: 9500") 
            {
                this.showDebugWionw(arg1);
            }
            if (Cache.instance.copy.isInRaceCopy() && GameConst.RaceCopyThrowSkillWork) 
            {
                if (arg1 == KeyCode.Q || arg1 == KeyCode.W || arg1 == KeyCode.E || arg1 == KeyCode.R) 
                {
                    return true;
                }
            }
            else if (arg1 != KeyCode.F2) 
            {
                if (arg1 == KeyCode.ESCAPE) 
                {
                    if (ThingUtil.selectEntity) 
                    {
                        ThingUtil.selectEntity.selected = false;
                    }
                    else 
                    {
                        PopupManager.closeTopWindow();
                    }
                    return true;
                }
                if (arg1 == KeyCode.F8) 
                {
                    JSASSender.instance.callMapResize(1);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.StageResizeF8));
                    return true;
                }
                if (arg1 == KeyCode.F9) 
                {
                    SystemSetter.setShowHideValue();
                    ThingUtil.isEntitySort = true;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ScreenOrShowPlayer, SystemSetter.currentSetter.hideNearPlayerPet));
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SaveForSliderChange));
                    return true;
                }
                if (arg1 == KeyCode.SPACE) 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SpaceDropItem));
                    return true;
                }
                if (arg1 == KeyCode.ENTER) 
                {
                    (GameController.chat.view as ChatModule).setChatInputFocus();
                    KeyBoardManager.instance.changeImeEnable(true);
                    return true;
                }
            }
            else if (Global.isDebugModle) 
            {
                this.popupView(DebugWindow.instance);
                return true;
            }
            return false;
        }

        /* internal  */KeyEventHandler(arg1: Object, arg2: KeyEvent): void
        {
            var keycode: Object;
            var event: KeyEvent;

            var loc1;
            keycode = arg1;
            event = arg2;
            if (keycode != ModuleType.Test) 
            {
                if (keycode != ModuleType.DownUpMounts) 
                {
                    if (keycode >= 1 && keycode <= 20) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.ShortCutsKey, keycode));
                    }
                    else if (keycode != ModuleType.AutoFight) 
                    {
                        if (keycode != ModuleType.RangeAutoFight) 
                        {
                            if (keycode != ModuleType.Rest) 
                            {
                                this.popupWindow(keycode);
                            }
                            else if (KeyBoardCd.isKeyDown(event.keyEvent.keyCode)) 
                            {
                                RolePlayer.instance.readyRest();
                            }
                        }
                        else 
                        {
                            if (RolePlayer.instance.swimming) 
                            {
                                return;
                            }
                            GameController.scene.stopFollow();
                            ScreenOperation.interruptToAutoFight((): void
                            {
                                Dispatcher.dispatchEvent(new DataEvent(EventName.AutoFightPointShortcut));
                                return;
                            })
                        }
                    }
                    else 
                    {
                        if (RolePlayer.instance.swimming) 
                        {
                            return;
                        }
                        GameController.scene.stopFollow();
                        ScreenOperation.interruptToAutoFight((): void
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.AutoFightKeyToFight));
                            return;
                        })
                    }
                }
                else 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.KeyControllMounts));
                }
            }
            else if (Global.isDebugModle) 
            {
                if (!this._testPanel) 
                {
                    this._testPanel = new TestPanel();
                }
                this.popupView(this._testPanel);
            }
            return;
        }

        /* internal  */debug(): void
        {
            ArenaCrossBetWindow.instance.show();
            Dispatcher.dispatchEvent(new DataEvent(EventName.ShowDomWarBeaconBtn));
            return;
        }

        /* internal  */onTimerEvent(arg1: Object /* flash.events.Event */): void
        {
            SoundManager.instance.soundPlay(SoundTypeConst.Fireworks);
            return;
        }

        public popupWindow(arg1: Object): void
        {
            var loc1=false;
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc5=null;
            var loc6=null;
            var loc7=false;
            var loc8=null;
            var loc9=0;
            var loc10=0;
            this._soundPlayed = false;
            var loc11=arg1;
            switch (loc11) 
            {
                case ModuleType.SwitchTarget:
                {
                    loc1 = SystemSetter.currentSetter.notSelectPet;
                    ThingUtil.entityUtil.tabSelectPlayer(loc1);
                    break;
                }
                case ModuleType.Players:
                {
                    this.popupView(GameController.player.view);
                    break;
                }
                case ModuleType.Pack:
                {
                    if (GameController.pack.view.isHide) 
                    {
                        this.playSound(SoundTypeConst.OpenBackpack);
                    }
                    this.popupView(GameController.pack.view);
                    break;
                }
                case ModuleType.Skills:
                {
                    if (Cache.instance.mainUINavbar.canModuleShow(ModuleType.Skills)) 
                    {
                        this.popupView(GameController.skill.view);
                    }
                    break;
                }
                case ModuleType.Tasks:
                {
                    this.playSound(SoundTypeConst.OpenTaskPane);
                    this.popupView(GameController.task.view);
                    break;
                }
                case ModuleType.Pets:
                {
                    if (Cache.instance.mainUINavbar.canModuleShow(ModuleType.Pets)) 
                    {
                        this.popupView(GameController.pet.view);
                    }
                    break;
                }
                case ModuleType.MagicWeapon:
                {
                    this.popupView(GameController.magicWeapon.view);
                    break;
                }
                case ModuleType.Mounts:
                {
                    if (Cache.instance.mainUINavbar.canModuleShow(ModuleType.Mounts)) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.MountShowModule));
                    }
                    break;
                }
                case ModuleType.Pay:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GotoPay));
                    break;
                }
                case ModuleType.Guild:
                {
                    if (Cache.instance.guild.hasNewApply && Cache.instance.guild.myGuildInfo) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.OpenGuildWindow, 1));
                        Dispatcher.dispatchEvent(new DataEvent(GuildEventName.OpenGuildApplyListWindow));
                        Cache.instance.guild.hasNewApply = false;
                    }
                    else if (Cache.instance.guildUnion.hasUnionApply && Cache.instance.guild.isGuildLeader) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.OpenGuildWindow, 9));
                        Dispatcher.dispatchEvent(new DataEvent(EventName.GuildUnionShowInviteList, GuildUnionPosition.GuildUnionPositionOne));
                        Cache.instance.guildUnion.hasUnionApply = false;
                    }
                    else if (Cache.instance.country.isOpenCountry) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CountryPositionOpen));
                    }
                    else if (Cache.instance.mainUINavbar.canModuleShow(ModuleType.Guild)) 
                    {
                        this.popupView(GameController.guild.view);
                    }
                    break;
                }
                case ModuleType.Fb:
                {
                    this.popupView(GameController.copy.view);
                    break;
                }
                case ModuleType.Fairyland:
                {
                    if (!(Cache.instance.role.entityInfo.career == ECareer._ECareerNo) && !(Cache.instance.role.entityInfo.career == ECareer._ECareerNewPlayer)) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.TreasureModuleOpen));
                    }
                    else if (Cache.instance.role.entityInfo.level < 12) 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(35020));
                    }
                    else 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(35021));
                    }
                    break;
                }
                case ModuleType.ExploreShop:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ExploreShopOpen));
                    if (!(Cache.instance.role.entityInfo.career == ECareer._ECareerNo) && !(Cache.instance.role.entityInfo.career == ECareer._ECareerNewPlayer)) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.IntegralShopModuleOpen));
                    }
                    else if (Cache.instance.role.entityInfo.level < 12) 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(35020));
                    }
                    else 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(35021));
                    }
                    break;
                }
                case ModuleType.PetsRest:
                {
                    loc2 = GameController.gameui.getGameui().getPetAvatarSPetInfo();
                    if (loc2) 
                    {
                        if (PetUtil.isBattled(loc2)) 
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.PetRest));
                        }
                        else 
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.PetBattle, loc2));
                        }
                    }
                    else 
                    {
                        MsgManager.showRollTipsMsg("请在宠物界面选择出战宠物");
                    }
                    break;
                }
                case ModuleType.XpSkill:
                {
                    if (Global.isDebugModle) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CrossPVP_openTestInterface));
                        return;
                    }
                    if (Cache.instance.role.entityInfo.level >= 42) 
                    {
                        if (Cache.instance.role.roleInfo.energy >= GameConst.EnergyMax) 
                        {
                            if (loc3 = Cache.instance.skill.xpSkillInfo) 
                            {
                                Dispatcher.dispatchEvent(new DataEvent(EventName.SkillUseSkill, loc3));
                                Dispatcher.dispatchEvent(new DataEvent(EventName.FireXpSkillComplete));
                            }
                        }
                        else 
                        {
                            MsgManager.showRollTipsMsg("怒气值未满");
                        }
                    }
                    break;
                }
                case ModuleType.AllHide: case ModuleType.AllShow: case ModuleType.HalfHide:
                {
                    if (Cache.instance.copy.isInEatBeansCopy()) 
                    {
                        return;
                    }
                    SystemSetter.setShowHideValue();
                    ThingUtil.isEntitySort = true;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ScreenOrShowPlayer, SystemSetter.currentSetter.hideNearPlayerPet));
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SaveForSliderChange));
                    break;
                }
                case ModuleType.HideEffect: case ModuleType.ShowEffect:
                {
                    SystemSetter.setHideLightAndEffect(arg1 as string);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SaveForSliderChange));
                    break;
                }
                case ModuleType.Group:
                {
                    this.popupView(GameController.group.view);
                    break;
                }
                case ModuleType.Friend:
                {
                    this.popupView(GameController.friend.view);
                    break;
                }
                case ModuleType.Jewel:
                {
                    if (Cache.instance.mainUINavbar.canModuleShow(ModuleType.Jewel)) 
                    {
                        this.popupView(GameController.jewel.view);
                    }
                    break;
                }
                case ModuleType.Build:
                {
                    if (Cache.instance.mainUINavbar.canModuleShow(ModuleType.Build)) 
                    {
                        this.popupView(GameController.equipment.view);
                    }
                    break;
                }
                case ENpcEffect._ENpcEffectPlayWeaponCurt:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Equipment_DoCast_Strengthen, null));
                    break;
                }
                case ENpcEffect._ENpcEffectPlayWeaponPunch:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Equipment_DoCast_MakeHole, null));
                    break;
                }
                case ENpcEffect._ENpcEffectPlayWeaponRecast:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Equipment_DoCast_Recast, null));
                    break;
                }
                case ENpcEffect._ENpcEffectPlayWeaponStrengthen:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Equipment_DoCast_Strengthen, null));
                    break;
                }
                case ENpcEffect._ENpcEffectPlayJewelMosaic:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Equipment_DoCast_EmbedJewel, null));
                    break;
                }
                case ENpcEffect._ENpcEffectPlayJewelRemoved:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Equipment_DoCast_RemoveJewel, null));
                    break;
                }
                case ENpcEffect._ENpcEffectPlayJewelSynthesis:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Equipment_DoCast_ComposeJewel, null));
                    break;
                }
                case ENpcEffect._ENpcGuildFightJoin:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildWarEnter));
                    break;
                }
                case ENpcEffect._ENpcGuildFightInfo:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.OpenGuildWindow, 4));
                    break;
                }
                case ENpcEffect._ENpcGuildFightCurInfo:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildWarGetScoreList));
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildWarShowOrHideStatusModule, true));
                    break;
                }
                case ENpcEffect._ENpcEffectGuildFightMap:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildWarOpenOtherMap));
                    break;
                }
                case ENpcEffect._ENpcEffectGuildFightExit:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildWarLeave));
                    break;
                }
                case ENpcEffect._ENpcEffectArena:
                {
                    if (Cache.instance.wrestle.isCross() || Cache.instance.wrestle.isOpen) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.wrestleShowRoomWindow));
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.ArenaEnterWaitRoom));
                    }
                    break;
                }
                case ENpcEffect._ENpcEffectArenaInfo:
                {
                    if (Cache.instance.wrestle.isCross() || Cache.instance.wrestle.isOpen) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.WrestleShowWrestleWindow));
                    }
                    else 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.ArenaShowArenaWindow));
                    }
                    break;
                }
                case ENpcEffect._ENpcEffectArenaCross:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ArenaCrossEnterWaitRoom));
                    break;
                }
                case ENpcEffect._ENpcEffectArenaCrossInfo:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ArenaCrossShowArenaWindow));
                    break;
                }
                case ENpcEffect._ENpcEffectArenaCrossResult:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ArenaCrossShowSteleWindow));
                    break;
                }
                case ENpcEffect._ENpcEffectGangFights:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GangFightsShowGangFightsEnterWindow));
                    break;
                }
                case ENpcEffect._ENpcEffectGangFightsInfo:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GangFightsShowMainWindow));
                    break;
                }
                case ENpcEffect._ENpcEffectCopy129:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FairylandGetCopys));
                    break;
                }
                case ENpcEffect._ENpcEffectChristmasTree:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ChristmasTreeOpen));
                    break;
                }
                case ENpcEffect._ENpcEffectMoneyTree: case ENpcEffect._ENpcEffectLanternTree:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ChristmasTreeOpen));
                    break;
                }
                case ENpcEffect._ENpcEffectYourLover:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SunBathPass, -1));
                    break;
                }
                case ModuleType.PoBox:
                {
                    break;
                }
                case ModuleType.Fukatsu:
                {
                    break;
                }
                case ModuleType.Shops:
                {
                    if (GameController.shopMall.view.isHide != true) 
                    {
                        GameController.shopMall.view.hide();
                    }
                    else 
                    {
                        this.playSound(SoundTypeConst.OpenMall);
                        Dispatcher.dispatchEvent(new DataEvent(EventName.ShopMallOpen));
                    }
                    break;
                }
                case ModuleType.WareHouseBuyItem:
                {
                    this.popupView(GameController.wareHouseBuyItem.view);
                    break;
                }
                case ModuleType.WareHouseBuyExtendItem:
                {
                    this.popupView(GameController.wareHouseBuyExtendItem.view);
                    break;
                }
                case ModuleType.Speaker:
                {
                    this.popupView(GameController.speaker.view);
                    break;
                }
                case ModuleType.SysTips:
                {
                    this.popupView(GameController.sysHistory.view);
                    break;
                }
                case ModuleType.Activity: case ModuleType.Daily:
                {
                    if (Cache.instance.mainUINavbar.canModuleShow(ModuleType.Daily)) 
                    {
                        this.popupView(GameController.daily.view);
                    }
                    break;
                }
                case ModuleType.Bang:
                {
                    this.popupView(GameController.ranking.view);
                    break;
                }
                case ModuleType.Market:
                {
                    if (Cache.instance.mainUINavbar.canModuleShow(ModuleType.Market)) 
                    {
                        this.popupView(GameController.market.view);
                    }
                    break;
                }
                case ModuleType.Fu:
                {
                    GameController.loginNotice.showGift();
                    break;
                }
                case ModuleType.Tu:
                {
                    if (Cache.instance.copy.isInEatBeansCopy()) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.ShowHideEatBeansSmallMap));
                    }
                    else 
                    {
                        this.popupView(GameController.bigMap.view);
                    }
                    break;
                }
                case ModuleType.AutoFight:
                {
                    AutoFight.localAutoFight.copy(AutoFight.currentAutoFight);
                    if (AutoFight.localAutoFight.isBrief) 
                    {
                        this.popupView(GameController.autoFightBrief.autoFightBrief);
                        GameController.autoFightBrief.autoFightComplex.hide();
                    }
                    else 
                    {
                        this.popupView(GameController.autoFightBrief.autoFightComplex);
                        GameController.autoFightBrief.autoFightBrief.hide();
                    }
                    break;
                }
                case ModuleType.Mail:
                {
                    this.popupView(GameController.mail.view);
                    break;
                }
                case ModuleType.Sound: case ModuleType.NoSound:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.BackGroundMusicOpenOrClose));
                    break;
                }
                case ModuleType.Zhu:
                {
                    break;
                }
                case ModuleType.SysSet:
                {
                    this.popupView(GameController.systemSetting.view);
                    break;
                }
                case ModuleType.GM:
                {
                    loc4 = ParamsConst.instance.gmUrl;
                    if (!((loc5 = ParamsConst.instance.gmJsFun) && BrowerManager.instance.asCallJsFun(loc5))) 
                    {
                        if (!(loc4 == null) && !(loc4 == "")) 
                        {
                            BrowerUtil.getUrl(loc4);
                        }
                        else 
                        {
                            this.popupView(GameController.gm.view);
                        }
                    }
                    break;
                }
                case ModuleType.FullScreen:
                {
                    JSASSender.instance.callMapResize(1);
                    Dispatcher.dispatchEvent(new DataEvent(EventName.StageResizeF8));
                    break;
                }
                case ModuleType.Award:
                {
                    break;
                }
                case ModuleType.Target:
                {
                    this.popupView(GameController.target.view);
                    break;
                }
                case ModuleType.Hui:
                {
                    this.popupView(GameController.twHui.view);
                    break;
                }
                case ENpcEffect._ENpcEffectPlayPetReincarnation: case ENpcEffect._ENpcEffectPlayPetSkillUpgrade: case ENpcEffect._ENpcEffectPlayPetWeaponSynthesis: case ENpcEffect._ENpcEffectPass: case ENpcEffect._ENpcEffectPlay:
                {
                    break;
                }
                case ENpcEffect._ENpcEffectDrugShop: case ENpcEffect._ENpcEffectCopyShop1:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpen, {"shopCode": ShopRule.getShopId(int(arg1)), "shopType": DrugShop}));
                    break;
                }
                case ENpcEffect._ENpcEffectDefenseShop1: case ENpcEffect._ENpcEffectDefenseShop2: case ENpcEffect._ENpcEffectDefenseShop3:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpen, {"shopCode": ShopRule.getShopId(int(arg1)), "shopType": ArmorShop}));
                    break;
                }
                case ENpcEffect._ENpcEffectWeaponShop1: case ENpcEffect._ENpcEffectWeaponShop2: case ENpcEffect._ENpcEffectWeaponShop3:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpen, {"shopCode": ShopRule.getShopId(int(arg1)), "shopType": WeaponShop}));
                    break;
                }
                case ENpcEffect._ENpcEffectShop: case ENpcEffect._ENpcEffectPetShop: case ENpcEffect._ENpcEffectSoulFragmentExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpen, {"shopCode": ShopRule.getShopId(int(arg1)), "shopType": DefaultShop}));
                    break;
                }
                case ENpcEffect._ENpcEffectItemExchangeShop1: case ENpcEffect._ENpcEffectZhuXianPiecesExchange: case ENpcEffect._ENpcEffectTianCiPiecesExchange: case ENpcEffect._ENpcEffectChristmasExchange: case ENpcEffect._ENpcEffectNewYearExchange: case ENpcEffect._ENpcEffectLanternExchange: case ENpcEffect._ENpcEffectValentineExchange: case ENpcEffect._ENpcEffectZhuShenExchange: case ENpcEffect._ENpcEffect51Exchange: case ENpcEffect._ENpcEffect61Exchange: case ENpcEffect._ENpcEffectAnniversaryExchange: case ENpcEffect._ENpcEffect55Exchange: case ENpcEffect._ENpcEffect71Exchange1: case ENpcEffect._ENpcEffect71Exchange2: case ENpcEffect._ENpcEffect77Exchange: case ENpcEffect._ENpcEffectMidAutumnExchange: case ENpcEffect._ENpcEffecHalloweenExchange: case ENpcEffect._ENpcEffecThanksgivingExchange: case ENpcEffect._ENpcEffectLGXB: case ENpcEffect._ENpcEffecChristmasExchange: case ENpcEffect._ENpcEffecTujianExchange: case ENpcEffect._ENpcEffecLabaExchange: case ENpcEffect._ENpcEffecActiveExchange: case ENpcEffect._ENpcEffecExchange32: case ENpcEffect._ENpcEffecExchange33: case ENpcEffect._ENpcEffecHarmMedalLowerExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpen, {"shopCode": ShopRule.getShopId(int(arg1)), "shopType": ExchangeShop}));
                    break;
                }
                case ENpcEffect._ENpcEffectHonsExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitHonour}));
                    break;
                }
                case ENpcEffect._ENpcEffectHonsServerExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitInterHonour}));
                    break;
                }
                case ENpcEffect._ENpcEffectAthleticsExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitArena}));
                    break;
                }
                case ENpcEffect._ENpcEffectArenaCrossShop:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitArenaCrossCoin}));
                    break;
                }
                case ENpcEffect._ENpcEffectPetCpnExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitPetCoin}));
                    break;
                }
                case ENpcEffect._ENpcEffectRobIslandExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitRobIslandCoin}));
                    break;
                }
                case ENpcEffect._ENPCEffectSpiritCoinChange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitSpiritCoin}));
                    break;
                }
                case ENpcEffect._ENpcEffectLadderShop:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitLadder}));
                    break;
                }
                case ENpcEffect._ENpcEffectCrossSpiritWarShop:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.AttachedSoulBattlefieldRestRoomEnter));
                    break;
                }
                case ENpcEffect._ENpcEffectLadder:
                {
                    GameProxy.copy.getLadderMyInfo();
                    break;
                }
                case ENpcEffect._ENpcEffectMoshiExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitMagicStone}));
                    break;
                }
                case ENpcEffect._ENpcEffecCountryContributionExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitCountryContribution}));
                    break;
                }
                case ENpcEffect._ENpcEffectDominionShop:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": ShopRule.getShopId(int(arg1)), "type": _EPriceUnitDominion}));
                    break;
                }
                case ENpcEffect._ENpcEffectMeritExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenMerit, ShopRule.getShopId(int(arg1))));
                    break;
                }
                case ENpcEffect._ENpcEffectShopGroceries: case ENpcEffect._ENpcEffectNewSkillBookExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpen, {"shopCode": ShopRule.getShopId(int(arg1)), "shopType": DefaultShop}));
                    break;
                }
                case ENpcEffect._ENpcEffectTitleChange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpen, {"shopCode": ShopRule.getShopId(int(arg1)), "shopType": LoveTileShop}));
                    break;
                }
                case ENpcEffect._ENpcEffectPlayStorage:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.StorageOpen));
                    break;
                }
                case ENpcEffect._ENpcEffectTransport:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.TransportInfoReq));
                    break;
                }
                case ENpcEffect._ENpcEffectSingleCopy: case ENpcEffect._ENpcEffectTeamsCopy: case ENpcEffect._ENpcEffectPetCopy: case ENpcEffect._ENpcEffectCopy1: case ENpcEffect._ENpcEffectCopy35: case ENpcEffect._ENpcEffectCopy40: case ENpcEffect._ENpcEffectCopy111: case ENpcEffect._ENpcEffectCopy112: case ENpcEffect._ENpcEffectCopy102: case ENpcEffect._ENpcEffectCopy114: case ENpcEffect._ENpcEffectCopy115: case ENpcEffect._ENpcEffectCopy116: case ENpcEffect._ENpcEffectFairyland: case ENpcEffect._ENpcEffectCopy124: case ENpcEffect._ENpcEffectCopy125: case ENpcEffect._ENpcEffectCopy126: case ENpcEffect._ENpcEffectCopy127: case ENpcEffect._ENpcEffectCopy131: case ENpcEffect._ENpcEffectCopy118: case ENpcEffect._ENpcEffectCopy146: case ENpcEffect._ENpcEffectCopy140: case ENpcEffect._ENpcEffectCopy141: case ENpcEffect._ENpcEffectCopy149: case ENpcEffect._ENpcEffectEighty: case ENpcEffect._ENpcEffectCrossDefenceCopy: case ENpcEffect._ENpcEffectCrossDefenceCopyHard: case ENpcEffect._ENpcEffectCrossAryadevaSecret: case ENpcEffect._ENpcEffectCrossTowerCopy: case ENpcEffect._ENpcEffectDefenseEightyCopy: case ENpcEffect._ENpcEffectEnterFireMonsterIsland: case ENpcEffect._ENpcEffectEnterUpgradeCrossSecret: case ENpcEffect._ENpcEffectCopy189: case ENpcEffect._ENpcEffectCopyTower191: case ENpcEffect._ENpcEffectCopyMount: case ENpcEffect._ENpcEffectCopyMountAdvanced: case ENpcEffect._ENpcEffectCopyMountThird: case ENpcEffect._ENpcEffectCopyChoiceTemple: case ENpcEffect._ENpcEffectCopyMaterialCopy105: case ENpcEffect._ENpcEffectFireHellTeam:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CopyCopyChooseFromNpc, this.getCopyId(int(arg1))));
                    break;
                }
                case ENpcEffect._ENpcEffectEnterFireIslandCenter:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Lv88TeamShowEnterWin));
                    break;
                }
                case ENpcEffect._ENpcEffectSeal:
                {
                    if (loc6 = Cache.instance.role.levelSealInfo) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.CopyCopyChooseFromNpc, CopyConfig.instance.getSealCopyCodeByLevel(loc6.level)));
                    }
                    break;
                }
                case ENpcEffect._ENpcEffectDirectionCopy:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GetDirectionCopyInfo));
                    break;
                }
                case ENpcEffect._ENpcEffectCopy120:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SpaShowSpaEntrance));
                    break;
                }
                case ENpcEffect._ENpcEffectExit120:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SpaLeaveSpa));
                    break;
                }
                case ENpcEffect._ENpcEffectFairyland:
                {
                    loc7 = Cache.instance.copy.isFairylandOpen;
                    break;
                }
                case ENpcEffect._ENpcEffectCopy142:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildOpenCopyWindow));
                    break;
                }
                case ENpcEffect._ENpcEffectCopy148:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildOpenCopyWindow, ECopyType._ECopyGuildDefense));
                    break;
                }
                case ModuleType.CareerUpdate:
                {
                    this.popupView(GameController.career.view);
                    break;
                }
                case ModuleType.GuideItem:
                {
                    GameController.guideItem.view.show();
                    break;
                }
                case ModuleType.GuideWelcome:
                {
                    GameController.guideWelcome.view.show();
                    break;
                }
                case ENpcEffect._ENpcGuildTask:
                {
                    break;
                }
                case ENpcEffect._ENpcGuildDailyGift:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildGetAward));
                    break;
                }
                case ENpcEffect._ENpcGuildBuyTerritory:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.OpenGuildBuyManorWindow));
                    break;
                }
                case ENpcEffect._ENpcGuildInMyTerritory:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildEnterManor, {"guildId": Cache.instance.guild.myGuildInfo.guildId, "useContribution": false}));
                    break;
                }
                case ENpcEffect._ENpcGuildInOtherTerritory:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildOpenManorListWindow));
                    break;
                }
                case ENpcEffect._ENpcEffectPetStorage:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PetStorageOpen));
                    break;
                }
                case ENpcEffect._ENpcGuildMemberMagt:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.OpenGuildWindow, 1));
                    break;
                }
                case ENpcEffect._ENpcGuildBuildInfo:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.OpenGuildWindow, 2));
                    break;
                }
                case ENpcEffect._ENpcEffectBeastShow:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.OpenGuildWindow, 6));
                    break;
                }
                case ENpcEffect._ENpcEffectCopy147:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildEnterPasture));
                    break;
                }
                case ENpcEffect._ENpcGuildShop:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildOpenShop));
                    break;
                }
                case ENpcEffect._ENpcGuildStorage:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildWarehouseOpen));
                    GameController.guildWarehouse.isWarehouseOpenByNpc = true;
                    break;
                }
                case ENpcEffect._ENpcEffectRunBusiness:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.RunBusinessCurrentNpc, Cache.instance.dialog.npcInfo.tnpc.npcId));
                    break;
                }
                case ENpcEffect._ENpcGuildMoneyTree:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildOpenAuraWindow));
                    break;
                }
                case ENpcEffect._ENpcGuildJoin:
                {
                    this.popupView(GameController.guild.view);
                    break;
                }
                case ENpcEffect._ENpcEffectEvilTask:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.KillEvilTaskOpenTaskWin));
                    break;
                }
                case ENpcEffect._ENpcEffectSectarianTask:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SectarianTaskWinOpen));
                    break;
                }
                case ENpcEffect._ENpcEffectCentralTask:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CentralTaskWinOpen));
                    break;
                }
                case ENpcEffect._ENpcGuildCreate:
                {
                    Dispatcher.dispatchEvent(new DataEvent(GuildEventName.OpenCreateGuildWindow));
                    break;
                }
                case ENpcEffect._ENpcEffectPetCultivation:
                {
                    this.popupView(GameController.petpractice.view);
                    break;
                }
                case ENpcEffect._ENpcEffectPetModelRecover:
                {
                    PetRecoverWindow.instance.show();
                    break;
                }
                case ENpcEffect._ENpcEffectUpdateCareer:
                {
                    if (RolePlayer.instance.entityInfo.entityInfo.career == ECareer._ECareerNewPlayer || RolePlayer.instance.entityInfo.entityInfo.career == ECareer._ECareerNo) 
                    {
                        GameController.career.view.show();
                    }
                    else 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(20019));
                    }
                    break;
                }
                case ENpcEffect._ENpcEffectExitCopy126:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CopyQuitCopy));
                    break;
                }
                case ENpcEffect._ENpcEffectCopyDigitalLevel:
                {
                    GameProxy.copy.getMagicTowerQuestion(false);
                    break;
                }
                case ENpcEffect._EnpcEffectCopyDigitalReset:
                {
                    GameProxy.copy.getMagicTowerQuestion(true);
                    break;
                }
                case ENpcEffect._ENpcEffectMarryRegister:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MarryNPCApplyMarry));
                    break;
                }
                case ENpcEffect._ENpcEffectMarryAppCeremony:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MarryNPCBookingScene));
                    break;
                }
                case ENpcEffect._ENpcEffectMarryInvitedGuests:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MarryNPCInviteGuests, true));
                    break;
                }
                case ENpcEffect._ENpcEffectMarryParade:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MarryNPCParade));
                    break;
                }
                case ENpcEffect._ENpcEffectMarryCelebration:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MarryNPCCelebration));
                    break;
                }
                case ENpcEffect._ENpcEffectMarryUnRegister:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MarryNPCDivorce));
                    break;
                }
                case ENpcEffect._ENpcEffectMarryIntroduction:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MarryNPCMarryLog));
                    break;
                }
                case ENpcEffect._ENpcEffectMarryProcess:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.MarryNPCMarryProcess));
                    break;
                }
                case ENpcEffect._ENpcEffectSexChange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SexChangeOpen));
                    break;
                }
                case ENpcEffect._ENpcEffectCampChange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CampChangeOpen));
                    break;
                }
                case ENpcEffect._ENpcEffectHuntTask:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.HuntDialogShow));
                    break;
                }
                case ENpcEffect._ENpcEffectNationalTreasure1:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.NationalTreasure1OptOpen));
                    break;
                }
                case ENpcEffect._ENpcEffectNationalTreasure2:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.NationalTreasure2OptOpen));
                    break;
                }
                case ENpcEffect._ENpcEffectNewCard:
                {
                    BrowerUtil.getUrl(ParamsConst.instance.xskUrl);
                    break;
                }
                case ENpcEffect._ENpcEffectNewCardExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.NoviceCardOpen));
                    break;
                }
                case ENpcEffect._ENpcEffectCopy139:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.GuildAnimalCopyEnter));
                    break;
                }
                case ENpcEffect._ENpcEffectGetWuxingJin:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CopyGuildAddWuxingAtt, EWuXingAttribute._EWuXingAttributeGold));
                    break;
                }
                case ENpcEffect._ENpcEffectGetWuxingMu:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CopyGuildAddWuxingAtt, EWuXingAttribute._EWuXingAttributeWood));
                    break;
                }
                case ENpcEffect._ENpcEffectGetWuxingShui:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CopyGuildAddWuxingAtt, EWuXingAttribute._EWuXingAttributeWater));
                    break;
                }
                case ENpcEffect._ENpcEffectGetWuxingHuo:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CopyGuildAddWuxingAtt, EWuXingAttribute._EWuXingAttributeFire));
                    break;
                }
                case ENpcEffect._ENpcEffectGetWuxingTu:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CopyGuildAddWuxingAtt, EWuXingAttribute._EWuXingAttributeEarth));
                    break;
                }
                case ENpcEffect._ENpcEffectTXDYCheckIn:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShowKingWarModule));
                    break;
                }
                case ModuleType.WuXing:
                {
                    if (Cache.instance.mainUINavbar.canModuleShow(ModuleType.WuXing)) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.WuXingWindowOpenReq));
                    }
                    break;
                }
                case ENpcEffect._ENpcEffectCareerChange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CareerUpdateModuleOpenReq));
                    break;
                }
                case ENpcEffect._ENpcEffectTXDYHandIn:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShowHandinMaterialFixStone));
                    break;
                }
                case ENpcEffect._ENpcEffectCakeHandIn:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShowHandinMaterialMakeCake));
                    break;
                }
                case ENpcEffect._ENpcEffectPetArena:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.PetCpnOpenWindow));
                    break;
                }
                case ENpcEffect._ENpcEffectStatuePlayer:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.NPCStatuePlayerReq));
                    break;
                }
                case ENpcEffect._ENpcEffectSunBathMakeUp:
                {
                    GameProxy.crossBeach.sunBathMakeUp();
                    break;
                }
                case ENpcEffect._ENpcEffectSunBathRemover:
                {
                    GameProxy.roleProxy.endModelChange();
                    break;
                }
                case ENpcEffect._ENpcEffectSecondCareer:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SecondCareerOpenTaskWin));
                    break;
                }
                case ENpcEffect._ENpcEffectSecondCareerSelect:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SecondCareerOpenSelectWin));
                    break;
                }
                case ENpcEffect._ENpcEffectSecondCareerTransform:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SecondCareerOpenTransformWin));
                    break;
                }
                case ENpcEffect._ENpcEffectFightSpirit:
                {
                    break;
                }
                case ENpcEffect._ENpcEffectOpenWorshipView:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CrossAdoreNpcReq));
                    break;
                }
                case ENpcEffect._ENpcEffectSpringFestivalNew: case ENpcEffect._ENpcEffectSpringFestivalSpring: case ENpcEffect._ENpcEffectSpringFestivalSpeed: case ENpcEffect._ENpcEffectSpringFestivalHappy:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.NpcAwardShowModule, arg1));
                    break;
                }
                case ENpcEffect._ENpcEffectRobCityIntro:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.RobCity_OpenRobCityModule, 0));
                    break;
                }
                case ENpcEffect._ENpcEffectCountryMoney:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CountryMoneyWindowOpen, arg1));
                    break;
                }
                case ENpcEffect._ENpcEffectRobFlagContributionExchange:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpenHonor, {"shopCode": RobFlagShopCode, "type": _EPriceUnitRobFlagHonour}));
                    break;
                }
                case ENpcEffect._ENpcEffectCrossGuildWar:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.CrossGuildWarShowModuleReq));
                    break;
                }
                case ENpcEffect._ENpcEffectSecondCareerReset:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.SecondCareerOpenChangeSecondCareer));
                    break;
                }
                case ENpcEffect._ENpcEffectCrossSpiritWarSignUp:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.AttachedSoulBattlefielApplyPanelShow));
                    break;
                }
                case ENpcEffect._ENpcEffectHitEgg:
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.HitEggOpenWindow));
                    break;
                }
                default:
                {
                    loc9 = (loc8 = GameDefConfig.instance.exchangeEffectList).length;
                    loc10 = 0;
                    while (loc10 < loc9) 
                    {
                        if (loc8[loc10] == arg1.toString()) 
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.ShopOpen, {"shopCode": ShopRule.getShopId(int(arg1)), "shopType": ExchangeShop}));
                        }
                        ++loc10;
                    }
                }
            }
            if (!this._soundPlayed) 
            {
                this.playSound(SoundTypeConst.UIclick);
            }
            return;
        }

        /* internal  */getCopyId(arg1: int): int
        {
            var loc1=arg1.toString().substring(2);
            return int(loc1);
        }

        public popupView(arg1: IView): void
        {
            if (arg1.isHide) 
            {
                arg1.show();
            }
            else 
            {
                arg1.hide();
            }
            return;
        }

        /* internal  */playSound(arg1: string): void
        {
            SoundManager.instance.soundPlay(arg1);
            this._soundPlayed = true;
            return;
        }

        public static get instance(): GameManager
        {
            return GameManager._instance;
        }

        /* internal */ /* var */_showHideNum: int=0;

        public /* var */leaveTime: number=0;

        /* internal */ /* var */_testPanel: TestPanel;

        /* internal */ /* var */w: CrossTaskWin;

        /* internal */ /* var */_soundPlayed: Boolean;

        /* internal */ static /* var */_instance: GameManager;
    }

            GameManager._instance = new GameManager();
        